package smedi.ismedi.web.bff.controller.report;


import com.smedi.ismedi.report.api.feign.RemoteReportFolwFeginApi;
import com.smedi.ismedi.report.api.model.dto.AppointVO;
import com.smedi.ismedi.report.api.model.dto.FlowPassDTO;
import com.smedi.ismedi.report.api.model.dto.RejectVO;
import com.smedi.ismedi.web.starter.common.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping(value = "/webbff/v1/flow")
@RestController
@Api(tags = {"填报流程"})
public class RemoteReportFolwController {
    @Autowired
    private RemoteReportFolwFeginApi remoteReportFolwFeginApi;
    @ApiOperation( value = "填报表单提交",nickname = "表单提交" )
    @PostMapping("/commit")
    ResponseData<String> commit(@RequestBody FlowPassDTO flowPassDTO){
      return   remoteReportFolwFeginApi.commit(flowPassDTO);
    }
    /**
     * 流程提交
     * @param flowPassDTO dto
     * @return ResponseData<String>
     */

    @ApiOperation( value = "填报流程提交",nickname = "流程提交" )
    @PostMapping("/pass")
    ResponseData<String> pass(@RequestBody FlowPassDTO flowPassDTO){


        return  remoteReportFolwFeginApi.pass(flowPassDTO);
    }
    /**
     *
     * @param appointVO 委派对象
     * @return ResponseData<String>
     */
    @ApiOperation( value = "填报流程委派(指定填报人)",nickname = "委派(指定填报人)" )
    @PostMapping("/appoint")
    ResponseData<String>  appoint(@RequestBody AppointVO appointVO){

        return  remoteReportFolwFeginApi.appoint(appointVO);
    }
    /**
     * 驳回
     */
    @PostMapping("/reject")
    @ApiOperation( value = "填报流程驳回",nickname = "驳回" )
    ResponseData<String> reject(@RequestBody RejectVO rejectVO){

        return  remoteReportFolwFeginApi.reject(rejectVO);
    }
}
